
<div class="aside">
	<div class="profile">
		<img src="<?php echo $user['avatar'] ?>" class="avatar" alt="...">
		<h3 class="name"><?php echo $user['nickname']; ?></h3>
	</div>
	<ul class="nav">
		<li <?php echo $current_page === "index"? "class='active'":''; ?>>
			<a href="./index.php">
				<i class="iconfont">&#xe754;</i>仪表盘
			</a>
		</li>
		<?php $menu_posts = array('posts', 'post-ad', 'categories') ?>
		<li <?php echo in_array($current_page, $menu_posts)? "class='active'": ''; ?>>
			<a href="#menu_posts" class="more <?php echo in_array($current_page, $menu_posts)? '': 'collapsed'; ?>" data-toggle="collapse">
				<i class="iconfont">&#xe618;</i>文章<i class="arr iconfont"></i>
			</a>
			<ul id="menu_posts" class="collapse <?php echo in_array($current_page, $menu_posts)? 'show': ''; ?>">
				<li <?php echo $current_page === 'posts'? "class='active'": ''; ?>>
					<a href="./posts.php">所有文章</a>
				</li>
				<li <?php echo $current_page === 'post-ad'? "class='active'": ''; ?>>
					<a href="./post-ad.php">写文章</a>
				</li>
				<li <?php echo $current_page === 'categories'? "class='active'": ''; ?>>
					<a href="./categories.php">分类目录</a>
				</li>
			</ul>
		</li>
		<li <?php echo $current_page === 'comments'? "class='active'": ''; ?>>
			<a href="./comments.php">
				<i class="iconfont">&#xe630;</i>评论
			</a>
		</li>
		<!-- 管理员功能 -->
		<?php if ($user['id'] === '1'): ?>
			<li <?php echo $current_page === "users"? "class='active'": ''; ?>>
				<a href="./users.php">
					<i class="iconfont">&#xe610;</i>用户
				</a>
			</li>
		<?php endif ?>

		<?php $menu_set = array('nav_menu', 'lunbo', 'web_set') ?>
		<li <?php echo $current_page === "set"? "class='set'": ''; ?>>
			<a href="#menu_set" data-toggle="collapse" aria-expanded="false" class="more <?php echo in_array($current_page, $menu_set)? '': 'collapsed'; ?>">
				<i class="iconfont">&#xe667;</i>设置
				<i class="arr iconfont"></i>
			</a>
			<ul id="menu_set" class="collapse <?php echo in_array($current_page, $menu_set)? 'show': ''; ?>" >
				<li <?php echo $current_page === 'nav_menu'? "class='active'": ''; ?>>
					<a href="javascript:;">导航菜单</a>
				</li>
				<li <?php echo $current_page === 'lunbo'? "class='active'": ''; ?>>
					<a href="javascript:;">图片轮播</a>
				</li>
				<li <?php echo $current_page === 'web_set'? "class='active'": ''; ?>>
					<a href="javascript:;">网站设置</a>
				</li>
			</ul>
		</li>
	</ul>
</div>